import ajax from "./ajax";
//获取品牌数据
export const reqTmList = (page, limit) =>
  ajax({ url: `/admin/product/baseTrademark/${page}/${limit}`, method: "get" });
//添加品牌
export const reqAddOrEdit = (tm) => {
  // 有id发送修改接口 没有id修改添加接口
  if (tm.id) {
    return ajax({
      url: "/admin/product/baseTrademark/update",
      method: "put",
      data: tm,
    });
  } else {
    return ajax({
      url: "/admin/product/baseTrademark/save",
      method: "post",
      data: tm,
    });
  }
};

//删除品牌
export const reqDelete = (id) =>
  ajax({
    url: `/admin/product/baseTrademark/remove/${id}`,
    method: "delete",
  });
